﻿using BCCommon.TMS.Insurance;
using BCEntity.TMS.PersonalInsuranceRecord;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.PersonalInsuranceRecord
{
    public interface IPersonalInsuranceRecordData
    {
        /// <summary>
        /// 新增个人保单记录
        /// </summary>
        /// <param name="entity">个人保单信息</param>
        /// <returns></returns>
        Task<PersonalInsuranceRecordEntity> InserAsync(PersonalInsuranceRecordEntity entity);

        /// <summary>
        /// 分页查询个人保单信息
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="underwritingCompany">承保公司</param>
        /// <param name="insured">被保人</param>
        /// <param name="identityCardNo">身份证号</param>
        /// <param name="status">状态</param>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <param name="ascending">是否升序排序</param>
        /// <param name="sortName">排序自动</param>
        /// <returns></returns>
        Task<(IEnumerable<PersonalInsuranceRecordEntity>, int)> GetAllAsync(long? companyId,string underwritingCompany, string insured, string identityCardNo, InsuranceStatus? status, int pageIndex, int pageSize, bool? ascending, string sortName);

        /// <summary>
        /// 删除指定的保单记录信息
        /// </summary>
        /// <param name="personalInsuranceRecordId">个人保单记录Id</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(long personalInsuranceRecordId);

        /// <summary>
        /// 修改指定的保单记录信息
        /// </summary>
        /// <param name="entity">个人保单信息</param>
        /// <returns></returns>
        Task<PersonalInsuranceRecordEntity> UpdateAsync(PersonalInsuranceRecordEntity entity);

        /// <summary>
        /// 根据身份证号获取保单列表
        /// </summary>
        /// <param name="identityCardNo">身份证号</param>
        /// <returns></returns>
        Task<IEnumerable<PersonalInsuranceRecordEntity>> GetListByIdentityCardNoAsync(string identityCardNo);


        /// <summary>
        /// 获取指定的保单记录信息
        /// </summary>
        /// <param name="personalInsuranceRecordId">个人保单记录Id</param>
        /// <returns></returns>
        Task<PersonalInsuranceRecordEntity> GetByPersonalInsuranceRecordIdAsync(long personalInsuranceRecordId);
        /// <summary>
        /// 检查是否存在
        /// </summary>
        /// <param name="personalInsuranceRecordId">个人保单记录Id</param>
        /// <returns></returns>
        Task<bool> ExistsByPersonalInsuranceRecordIdAsync(long personalInsuranceRecordId);

    }
}
